package by.msokoloff.javaweb2015.services;

import java.util.List;

import javax.persistence.metamodel.SingularAttribute;

import org.springframework.transaction.annotation.Transactional;

import by.msokoloff.javaweb2015.datamodel.Country;

public interface CountryService {

	Country get(Integer id);

	Long getCount();

	List<Country> getByField(SingularAttribute<Country, ?> attr, Object val);

	List<Country> getAll();

	List<Country> getAll(SingularAttribute<Country, ?> attr, boolean ascending, int startRecord, int pageSize);

	@Transactional
	void createOrUpdate(Country country);

	@Transactional
	void delete(Country country);

	@Transactional
	void deleteAll();

	@Transactional
	void deleteWithRelations(Country country);

}
